package com.lanqiao.testwork;

import java.util.Scanner;

public class Test14 {

	public static void main(String[] args) {
		// 方法调用
		test();

	}

	/**
	 * 输入某年某月某日输出第几天
	 */
	private static void test() {
		int d = 0;
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入年：");
		int iYear = sc.nextInt();
		System.out.println("请输入月：");
		int iMonth = sc.nextInt();
		System.out.println("请输入日：");
		int iDay = sc.nextInt();
		switch (iMonth) {
		case 1:
			d = iDay;break;
		case 2:
			d = iDay + 31;break;
		case 3:
			d = iDay + 31 + 28;break;
		case 4:
			d = iDay + 31 + 28 + 31;break;
		case 5:
			d = iDay + 31 + 28 + 31 + 30;break;
		case 6:
			d = iDay + 31 + 28 + 31 + 30 + 31;break;
		case 7:
			d = iDay + 31 + 28 + 31 + 30 + 31 + 30;break;
		case 8:
			d = iDay + 31 + 28 + 31 + 30 + 31 + 30 + 31;break;
		case 9:
			d = iDay + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31;break;
		case 10:
			d = iDay + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30;break;
		case 11:
			d = iDay + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;break;
		case 12:
			d = iDay + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;break;
		}
		// 判断是否为闰年
		if (iYear % 400 == 0 || iYear % 4 == 0 && iYear % 100 != 0) {
			if (iMonth > 2)
				d++;
		}
		System.out.println(iYear + "年" + iMonth + "月" + iDay + "日是第" + d + "天");

	}
}
